import './css/index.css';
/* global Vue */
const { createApp } = Vue;
createApp({
  data() {
    return {
      title: [
        {
          item: 'html',
        },
        {
          item: 'css',
        },
        {
          item: 'js',
        },
        {
          item: 'vuejs',
        },
      ],
      contents: [
        {
          item: 'html-contents',
        },
        {
          item: 'css-contents',
        },
        {
          item: 'js-contents',
        },
        {
          item: 'vuejs-contents',
        },
      ],
      // 要展示的数据
      showContent: 'html-contents',
    };
  },
  methods: {
    // 根据鼠标点击或者悬浮在title数组里item来返回content的item内容
    contentShow(index) {
      // console.log(index);
      this.showContent = this.contents[index].item;
    },
  },
}).mount('#app');
